[Cpp]/** Copyright (c) 2013, computer College, Yantai University* All rights reserved.* File name: test. cpp* Author: Qiu xuewei* Completion date: January 1, May 11, 2013* Version: v1.0* Input Description: None* Problem description: defines the vertex class and uses the vertex class as the base class to derive a straight line class. The vertex information inherited from the base class indicates the midpoint of the straight line.* Program output:* Problem analysis:* Algorithm Design: omitted*/# I
Representation% X Local Time Representation% Z Current Time Zone name
Code (python2.5.4 ):
import timeimport os#print the num(0-9)def printline(line,num): if line==1: if num==1: print ' # ', if num==0 or num==2 or num==3 or num==5 or num==6 or num==7 or num==8 or num==9: print '#### ', if num==4: print '# # ', if line==2: if num==1: print ' # ', if num==2 or n
]
[0 1 0 ..., 1 1 0]]
Features [' 1599 ', ' 1603 ', ' abhominably ', ' abhorred ', ' abide ']
4 Frequency analysis
The sample code is as follows:
def PrintLine(values, num, Keyorvalue, tag): "" "" "to print the specified list of the NUM element key or value, the output tag is tag:p AramValues: List:p AramNum: Number of output elements:p AramKeyorvalue: The key of the output element or the value 0 is the key, 1 represents the value:p AramTag: Output
VB, that is, to access the operation files directly through some related functions. The following table lists all available file access functions for three types of direct file access.
Function
Order
Random
Binary system
Description
FileOpen function
X
X
X
Open an input or output file
FileClose function
X
X
X
Close the file opened with the FileOpen function
Input function
X
X
Reads data from an open sequential file and assigns the data to a variable.
inputstring function
X
return
membersDouble Length (); // calculates and returns the Length of a straight line.Void PrintLine (); // two endpoints of the output line and the line lengthVoid PrintPoint ();Private:Class Point pts, pte; // two endpoints of a straight line};// The member functions of the Line class are defined belowLine: Line (Point pt1, Point pt2){Pts = pt1;Pte = pt2;}Double Line: Length (){Double d;D = sqrt (pts. x-pte.x) * (pts. x-pte.x)-(pts. y-pts.y) * (pts. y-p
Should the children's shoes still remember the programming question "printing star patterns? It's just as beautiful as our programming childhood. The length of the printed side is n diamond, ho, and some people immediately write it out:
Package patterns. interpretation; public class figureprinting {/*** print the number of edges of the diamond pattern * @ Param n diamond Based on the given n value */Public void printdiamond (int n) {If (n
Package patterns. interpretation; public class figurep
scale is opened, the program is executed in sequence. Unlike calling subprograms, the program will be faster ";2. The macro scale will increase the amount of code, resulting in a "large" program ".
A simple macro:
; Test34_1.asm.386.model flat, stdcallinclude windows. incinclude kernel32.incinclude masm32.incinclude debug. incincludelib kernel32.libincludelib masm32.libincludelib debug. LIB; defines a mexit macro printline retendm. co
procedure is used to print lines that do not contain the four special tags
Ispace=len (strline)-len (LTrim (strline))
I=1
while (Mid (strline,i,1)) =CHR (9)
Ispace=ispace+5
I=i+1
Wend
' Number of statistic blanks
If Ispace>0 Then
For I=1 to Ispace
Response.Write ("")
Next
End If
Ipos=instr (strline, "If IPOs then
Response.Write (Left (strline,ipos-1))
Response.Write ("' Use Strline=right (Strline,len (strline)-ipos)
Call Printhtml (strline)
' Since the call, until no Else
Response.Write (strlin
name list of all the printers on the computer.
var printers = PrintQueueHelper.GetPrintQueueName();
Select your invoice printer name from printers and use this name to obtain an IPrinter Print Object
var printer = PrinterFactory.GetPrinter("xp80mm", PaperWidth.Paper80mm);
The second parameter of GetPrinter can be used to input a PaperWidth enumeration, Which is predefined to 80, 76, and 58 widths, or a custom int value.The IPrinter object has five methods:
PrintText
PrintImage
Please click on the following address to download: CSV operation class
Instructions for use are as follows:
1. Generate a CSV file
Copy CodeThe code is as follows:
Require "./include/csvdatafile.php";
Set_time_limit (200);
Header ("content-type:application/rfc822");
Header (' content-disposition:attachment; Filename=export.csv ');
$arr _export_titles = Array ("Student number", "study number", "Student Name");
$csvfile = new Csvdatafile ("", ",", "w");
echo $csvfile->
Click Next to download: CSV operation class
The usage instructions are as follows:
1. Generate a CSV file
CopyCode The Code is as follows: require "./include/csvdatafile. php ";
Set_time_limit (200 );Header ("Content-Type: Application/rfc822 ");Header ('content-Disposition: attachment; filename=export.csv ');
$ Arr_export_titles = array ("student ID", "student ID", "Student name ");
$ Csvfile = new csvdatafile ("", "W ");Echo $ csvfile-> printl
process is the same, comparing 6 and 9, and so on, and finally getting the results. Codecout "Bubble Sort:"PrintLine ( "before sort: for (int i=0; i int temp = 0; for (int j=v.size ()-1; J>0; j--) { if (V[j] 1] { temp = v[j]; V[j] = V[j-1]; V[j-1] = Temp ; } } } PrintLine (after Sort: ", v); AnalysisSince each order adds a bubble to the ordered area, after n-1 sequencing, there are n-1
subsequent sorting process. The next bubble process is the same as 6 and 9, and so on. The final result is obtained.
Code
Cout " Bubble sort: " Printline ( " Before sort: " , V ); For ( Int I = 0 ; I Int Temp = 0 ;For ( Int J = V. Size ()- 1 ; J> 0 ; J --){ If (V [J] 1 ]) {Temp = V [J];V [J] = V [J- 1 ];V [J- 1 ] = Temp;}}}Printline ( " After sort: " , V );
Analysis
Because each sort adds a b
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.